home *** CD-ROM | disk | FTP | other *** search
- package Code.LIB.animators
- {
- import Code.LIB._be548;
- import flash.geom.Point;
-
- public class _wr378 extends _do643
- {
- public static const stNone:int = 0;
-
- public static const stMove:int = 1;
-
- public static const stDone:int = 2;
-
- private var iVelocity:Point;
-
- private var iTargetSpeed:Number;
-
- private var iToPoint:Point;
-
- private var iState:int;
-
- private var iTargetCoords:Point;
-
- public function _wr378(param1:_be548)
- {
- super(param1);
- }
-
- override public function _kx70() : Boolean
- {
- return iState == stDone;
- }
-
- override public function animate(param1:Object = null) : void
- {
- iToPoint = new Point(param1.toPoint.x,param1.toPoint.y);
- iVelocity = new Point();
- iTargetCoords = new Point(target._vq458,target._vg471);
- iTargetSpeed = 2;
- iState = stMove;
- }
-
- override public function onEnterFrame() : void
- {
- var _loc1_:Number = NaN;
- super.onEnterFrame();
- switch(iState)
- {
- case stMove:
- _loc1_ = Math.sqrt((iToPoint.x - iTargetCoords.x) * (iToPoint.x - iTargetCoords.x) + (iToPoint.y - iTargetCoords.y) * (iToPoint.y - iTargetCoords.y));
- if(_loc1_ < iTargetSpeed)
- {
- target._vq458 = iToPoint.x;
- target._vg471 = iToPoint.y;
- iState = stDone;
- }
- if(_loc1_ < 150 && iTargetSpeed > 20)
- {
- iTargetSpeed -= 4;
- }
- else if(_loc1_ > 150 && iTargetSpeed < 40)
- {
- iTargetSpeed += 1;
- }
- iVelocity.x = iToPoint.x - iTargetCoords.x;
- iVelocity.y = iToPoint.y - iTargetCoords.y;
- iVelocity.normalize(iTargetSpeed);
- iTargetCoords.x += iVelocity.x;
- iTargetCoords.y += iVelocity.y;
- target._xe768(iTargetCoords.x,iTargetCoords.y);
- }
- }
- }
- }
-
-